package com.ruanyun.modular.admin.mapper;

import com.ruanyun.modular.admin.entity.TProductinfo;
import com.ruanyun.modular.admin.entity.TProductionProcess;
import com.ruanyun.modular.admin.model.params.TProductionProcessParam;
import com.ruanyun.modular.admin.model.result.TProductinfoResult;
import com.ruanyun.modular.admin.model.result.TProductionProcessResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 生产工艺 Mapper 接口
 * </p>
 *
 * @author zs
 * @since 2021-04-17
 */
@Repository
public interface TProductionProcessMapper extends BaseMapper<TProductionProcess> {

    /**
     * 获取列表
     *
     * @author zs
     * @Date 2021-04-17
     */
    List<TProductionProcessResult> customList(@Param("paramCondition") TProductionProcessParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zs
     * @Date 2021-04-17
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TProductionProcessParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zs
     * @Date 2021-04-17
     */
    Page<TProductionProcessResult> customPageList(@Param("page") Page page, @Param("paramCondition") TProductionProcessParam paramCondition);


    Page<TProductionProcessResult> customPageList1(@Param("page") Page page, @Param("paramCondition") TProductionProcessParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zs
     * @Date 2021-04-17
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TProductionProcessParam paramCondition);


    /*根据companyId 查询是否存在数据*/
    @Select("SELECT * FROM t_production_process WHERE company_id = #{companyId}  and del_flag != 2 ")
    List<TProductionProcess> getDetails(@Param("companyId")Long companyId);


    Page<TProductionProcessResult> getProductionProcessPage(@Param("pageContext") Page pageContext, @Param("companyId") Integer companyId);

    @Select("SELECT * FROM t_production_process WHERE company_id = #{companyId}  and del_flag != 2 ")
    List<TProductionProcessResult>  getProcessList(@Param("companyId") Integer companyId);

}
